#!/usr/bin/env python3
#
# creating and modifying a list
#
# http://www.upriss.org.uk/python/session5.html

##    1.1) Create a list that contains the names of 5 students of this
##    class. (Do not ask for input to do that, simply create the list.)
##    Print the list. Ask the user to input one more name and append it to
##    the list. Print the list. Ask a user to input a number. Print the name
##    that has that number as index. Add "John Smith" and "Mary Miller" at
##    the beginning of the list (by using "+"). Print the list.

# http://jv.gilead.org.il/zydorczak/chamet00.html

students = ["Pierre Aronnax", "Ned Land", "Capitaine Nemo", "Francis Gordon", "Sydney Hudelson"]

print("The class has the following", len(students), "students:", students)

new_student = input("Which student would you like to add? ")
students.append(new_student)
print("The class has the following", len(students), "students:", students)

asked_student = input("Which student would you like to see? (enter a number) ")
print("This is your student: ", students[int(asked_student)-1])

students = ["John Smith", "Mary Miller"] + students
print("Added ", students[:2])
print("The class has now the following", len(students), "students:", students)
